<script type="text/javascript">

    RED.nodes.registerType('ezviz-ys7', {
        category: '萤石',
        color: '#7ac6cb',
        paletteLabel: '萤石指纹锁',
        label() {
            return this.name || '萤石指纹锁'
        },
        defaults: {
            name: {
                value: ''
            },
            ezviz: {
                value: '',
                type: 'ezviz-configurator'
            },
            deviceSerial: {
                value: ''
            },
          
        },
        inputs: 1,
        outputs: 2,
        icon: 'white-globe.png'
    })

    RED.nodes.registerType('ezviz-capture', {
        category: '萤石',
        color: '#7ac6cb',
        paletteLabel: '萤石抓拍图片',
        label() {
            return this.name || '萤石抓拍图片'
        },
        defaults: {
            name: {
                value: ''
            },
            ezviz: {
                value: '',
                type: 'ezviz-configurator'
            },
            deviceSerial: {
                value: ''
            },
            channelNo: {
                value: 1
            }
          
        },
        inputs: 1,
        outputs: 2,
        icon: 'white-globe.png'
    })
    RED.nodes.registerType('ezviz-preset-move', {
        category: '萤石',
        color: '#7ac6cb',
        paletteLabel: '云台移动到预设点',
        label() {
            return this.name || '萤石云台移动到预设点'
        },
        defaults: {
            name: {
                value: ''
            },
            ezviz: {
                value: '',
                type: 'ezviz-configurator'
            },
            deviceSerial: {
                value: ''
            },
            channelNo: {
                value: 1
            },
            index: {
                value: 1
            }
          
        },
        inputs: 1,
        outputs: 2,
        icon: 'white-globe.png'
    })

    RED.nodes.registerType('ezviz-camera-list', {
        category: '萤石',
        color: '#7ac6cb',
        paletteLabel: '摄像机列表',
        label() {
            return this.name || '摄像机列表'
        },
        defaults: {
            name: {
                value: ''
            },
            ezviz: {
                value: '',
                type: 'ezviz-configurator'
            },
            pageStart: {
                value: 0
            },
            pageSize: {
                value: 10
            }
          
        },
        inputs: 1,
        outputs: 2,
        icon: 'white-globe.png'
    })

    RED.nodes.registerType('ezviz-scene-switch-status', {
        category: '萤石',
        color: '#7ac6cb',
        paletteLabel: '遮蔽开关状态',
        label() {
            return this.name || '遮蔽开关状态'
        },
        defaults: {
            name: {
                value: ''
            },
            ezviz: {
                value: '',
                type: 'ezviz-configurator'
            },
            deviceSerial: {
                value: ''
            }          
        },
        inputs: 1,
        outputs: 2,
        icon: 'white-globe.png'
    })

    RED.nodes.registerType('ezviz-scene-switch-set', {
        category: '萤石',
        color: '#7ac6cb',
        paletteLabel: '遮蔽开关设置',
        label() {
            return this.name || '遮蔽开关设置'
        },
        defaults: {
            name: {
                value: ''
            },
            ezviz: {
                value: '',
                type: 'ezviz-configurator'
            },
            deviceSerial: {
                value: ''
            }            ,
            enable: {
                value: 0
            },
            channelNo: {
                value: 1
            }

        },
        inputs: 1,
        outputs: 2,
        icon: 'white-globe.png'
    })

</script>

<script type="text/x-red" data-template-name="ezviz-ys7">
      <div class="form-row">
        <label for="node-input-ezviz"><i class="icon-tag"></i>配置</label>
        <input type="text" id="node-input-ezviz">
      </div>
      <div class="form-row">
        <label for="node-input-name"><i class="icon-tag"></i>名称</label>
        <input type="text" id="node-input-name">
      </div>
      <div class="form-row">
        <label for="node-input-deviceSerial"><i class="icon-tag"></i>序列号</label>
        <input type="text" id="node-input-deviceSerial" placeholder="设备序列号,存在英文字母的设备序列号，字母需为大写">
      </div>
     
      <div class="form-row">
        <label style="width: 100%;text-align: right;padding-right: 34px;box-sizing: border-box;" >
          <a href="https://bbs.iobroker.cn/thread-195-1-1.html" target="_blank">手摸手图文教程 (ioBroker中国|智能家居)提供</a>
        </label>
      </div>
</script>
<script type="text/x-red" data-help-name="ezviz-ys7">
        <p>该接口用于分页获取指纹锁所在门的开门记录</p>
        <h3>输入</h3>
        <dl class="message-properties">
            <dt>payload
                <span class="property-type">string</span>
            </dt>
            <dd>萤石云设备序列号</dd>
          
        </dl>
        <h3>输出</h3>
        <p>当发生错误的时候，将会从输出2里面输出msg.payload = {} ,如果需要请做相关业务处理</p>
        <p>默认payload里面包含last和diff</p>
        <p>last: 最后打开门的人员信息</p>
        <p>diff: 是本地打开人员和上次不同的信息，默认没有缓存会展示最后20条信息</p>
        <table>
            <thead>
                <tr>
                    <th style="text-align:left">key</th>
                    <th style="text-align:left">类型</th>
                    <th style="text-align:center">备注</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td style="text-align:left">lockUserName</td>
                    <td style="text-align:left">String</td>
                    <td style="text-align:center">用户名</td>
                </tr>
                <tr>
                    <td style="text-align:left">openType</td>
                    <td style="text-align:left">Integer</td>
                    <td style="text-align:center">开锁方式(0-指纹 1-密码 2-卡)</td>
                </tr>
                <tr>
                    <td style="text-align:left">openTime</td>
                    <td style="text-align:left">Long</td>
                    <td style="text-align:center">开锁时间,时间格式为1457420564508,精确到毫秒</td>
                </tr>
            </tbody>
        </table>

        
</script>


<script type="text/x-red" data-template-name="ezviz-capture">
    <div class="form-row">
      <label for="node-input-ezviz"><i class="icon-tag"></i>配置</label>
      <input type="text" id="node-input-ezviz">
    </div>
    <div class="form-row">
      <label for="node-input-name"><i class="icon-tag"></i>名称</label>
      <input type="text" id="node-input-name">
    </div>
    <div class="form-row">
      <label for="node-input-deviceSerial"><i class="icon-tag"></i>序列号</label>
      <input type="text" id="node-input-deviceSerial" placeholder="设备序列号,存在英文字母的设备序列号，字母需为大写">
    </div>
    <div class="form-row">
        <label for="node-input-channelNo"><i class="icon-tag"></i>通道号</label>
        <input type="number" id="node-input-channelNo" placeholder="通道号，IPC设备填写1">
    </div>
   
    <div class="form-row">
      <label style="width: 100%;text-align: right;padding-right: 34px;box-sizing: border-box;" >
        <a href="https://bbs.iobroker.cn/thread-323-1-1.html" target="_blank">手摸手图文教程 (ioBroker中国|智能家居)提供</a>
      </label>
    </div>
</script>
<script type="text/x-red" data-help-name="ezviz-capture">
      <p>抓拍设备当前画面，该接口仅适用于IPC或者关联IPC的DVR设备，该接口并非预览时的截图功能。</p>
      <p>注意：设备抓图能力有限，请勿频繁调用，频繁调用将会被拉入限制黑名单,建议调用的间隔为4s左右。</p>
      <h3>输入</h3>
      <dl class="message-properties">
          <dt>payload
              <span class="property-type">string</span>
          </dt>
          <dd>萤石云设备序列号</dd>
        
      </dl>
      <h3>输出</h3>
      <p>当发生错误的时候，将会从输出2里面输出msg.payload = {} ,如果需要请做相关业务处理</p>
    
      <table>
          <thead>
              <tr>
                  <th style="text-align:left">key</th>
                  <th style="text-align:left">类型</th>
                  <th style="text-align:center">备注</th>
              </tr>
          </thead>
          <tbody>
              <tr>
                  <td style="text-align:left">picUrl</td>
                  <td style="text-align:left">String</td>
                  <td style="text-align:center">抓拍后的图片路径，图片保存有效期为2小时</td>
              </tr>
            
          </tbody>
      </table>

      
</script>
<script type="text/x-red" data-template-name="ezviz-preset-move">
    <div class="form-row">
      <label for="node-input-ezviz"><i class="icon-tag"></i>配置</label>
      <input type="text" id="node-input-ezviz">
    </div>
    <div class="form-row">
      <label for="node-input-name"><i class="icon-tag"></i>名称</label>
      <input type="text" id="node-input-name">
    </div>
    <div class="form-row">
      <label for="node-input-deviceSerial"><i class="icon-tag"></i>序列号</label>
      <input type="text" id="node-input-deviceSerial" placeholder="设备序列号,存在英文字母的设备序列号，字母需为大写">
    </div>
    <div class="form-row">
        <label for="node-input-channelNo"><i class="icon-tag"></i>通道号</label>
        <input type="number" id="node-input-channelNo" placeholder="通道号，IPC设备填写1">
    </div>
	<div class="form-row">
        <label for="node-input-index"><i class="icon-tag"></i>预置点</label>
        <input type="number" id="node-input-index" placeholder="预置点">
    </div>
   
    <div class="form-row">
      <label style="width: 100%;text-align: right;padding-right: 34px;box-sizing: border-box;" >
        <a href="https://bbs.iobroker.cn/thread-323-1-1.html" target="_blank">手摸手图文教程 (ioBroker中国|智能家居)提供</a>
      </label>
    </div>
</script>
<script type="text/x-red" data-help-name="ezviz-preset-move">
      <p>移动云台到预置点</p>
      <p>注意：请勿频繁调用，频繁调用将会被拉入限制黑名单,建议调用的间隔为4s左右。</p>
      <h3>输入</h3>
      <dl class="message-properties">
          <dt>payload
              <span class="property-type">string</span>
          </dt>
          <dd>萤石云设备序列号</dd>
		      <dt>index
              <span class="property-type">string</span>
          </dt>
          <dd>预置点号</dd>
        
      </dl>
      <h3>输出</h3>
      <p>当发生错误的时候，将会从输出2里面输出msg.payload = {} ,如果需要请做相关业务处理</p> 
</script>

<script type="text/x-red" data-template-name="ezviz-camera-list">
    <div class="form-row">
      <label for="node-input-ezviz"><i class="icon-tag"></i>配置</label>
      <input type="text" id="node-input-ezviz">
    </div>
    <div class="form-row">
      <label for="node-input-name"><i class="icon-tag"></i>名称</label>
      <input type="text" id="node-input-name">
    </div>
    <div class="form-row">
      <label for="node-input-pageStart"><i class="icon-tag"></i>起始页</label>
      <input type="number" id="node-input-pageStart" placeholder="分页起始页，从0开始">
    </div>
    <div class="form-row">
        <label for="node-input-pageSize"><i class="icon-tag"></i>每页数量</label>
        <input type="number" id="node-input-pageSize" placeholder="分页大小，默认为10，最大为50">
    </div>
  
   
    <div class="form-row">
      <label style="width: 100%;text-align: right;padding-right: 34px;box-sizing: border-box;" >
        <a href="https://bbs.iobroker.cn/thread-323-1-1.html" target="_blank">手摸手图文教程 (ioBroker中国|智能家居)提供</a>
      </label>
    </div>
</script>
<script type="text/x-red" data-help-name="ezviz-camera-list">
      <p>获取摄像头列表</p>     
      <h3>输入</h3>
      <dl class="message-properties">
          <dt>pageStart
              <span class="property-type">int</span>
          </dt>
          <dd>分页起始页，从0开始</dd>
      <dt>pageSize
              <span class="property-type">int</span>
          </dt>
          <dd>分页大小，默认为10，最大为50</dd>
        
      </dl>
      <h3>输出</h3>
      <p>当发生错误的时候，将会从输出2里面输出msg.payload = {} ,如果需要请做相关业务处理</p> 
</script>

<script type="text/x-red" data-template-name="ezviz-scene-switch-status">
    <div class="form-row">
      <label for="node-input-ezviz"><i class="icon-tag"></i>配置</label>
      <input type="text" id="node-input-ezviz">
    </div>
    <div class="form-row">
      <label for="node-input-name"><i class="icon-tag"></i>名称</label>
      <input type="text" id="node-input-name">
    </div>
    <div class="form-row">
      <label for="node-input-deviceSerial"><i class="icon-tag"></i>序列号</label>
      <input type="text" id="node-input-deviceSerial" placeholder="设备序列号,存在英文字母的设备序列号，字母需为大写">
    </div>    
   
    <div class="form-row">
      <label style="width: 100%;text-align: right;padding-right: 34px;box-sizing: border-box;" >
        <a href="https://bbs.iobroker.cn/thread-323-1-1.html" target="_blank">手摸手图文教程 (ioBroker中国|智能家居)提供</a>
      </label>
    </div>
</script>
<script type="text/x-red" data-help-name="ezviz-scene-switch-status">
      <p>获取镜头遮蔽开关状态</p>
      <p>注意：请勿频繁调用，频繁调用将会被拉入限制黑名单,建议调用的间隔为4s左右。</p>
      <h3>输入</h3>
      <dl class="message-properties">
          <dt>payload
              <span class="property-type">string</span>
          </dt>
          <dd>萤石云设备序列号</dd>      
        
      </dl>
      <h3>输出</h3>
      <p>当发生错误的时候，将会从输出2里面输出msg.payload = {} ,如果需要请做相关业务处理</p> 
</script>

<script type="text/x-red" data-template-name="ezviz-scene-switch-set">
    <div class="form-row">
      <label for="node-input-ezviz"><i class="icon-tag"></i>配置</label>
      <input type="text" id="node-input-ezviz">
    </div>
    <div class="form-row">
      <label for="node-input-name"><i class="icon-tag"></i>名称</label>
      <input type="text" id="node-input-name">
    </div>
    <div class="form-row">
      <label for="node-input-deviceSerial"><i class="icon-tag"></i>序列号</label>
      <input type="text" id="node-input-deviceSerial" placeholder="设备序列号,存在英文字母的设备序列号，字母需为大写">
    </div>
    <div class="form-row">
        <label for="node-input-channelNo"><i class="icon-tag"></i>通道号</label>
        <input type="number" id="node-input-channelNo" placeholder="通道号，IPC设备填写1">
    </div>
    <div class="form-row">
        <label for="node-input-enable"><i class="icon-tag"></i>状态</label>
        <select id="node-input-enable">
          <option value ="0">关闭</option>
          <option value ="1">开启</option>          
        </select>        
    </div>
   
    <div class="form-row">
      <label style="width: 100%;text-align: right;padding-right: 34px;box-sizing: border-box;" >
        <a href="https://bbs.iobroker.cn/thread-323-1-1.html" target="_blank">手摸手图文教程 (ioBroker中国|智能家居)提供</a>
      </label>
    </div>
</script>
<script type="text/x-red" data-help-name="ezviz-scene-switch-set">
      <p>设置镜头遮蔽开关</p>
      <p>注意：请勿频繁调用，频繁调用将会被拉入限制黑名单,建议调用的间隔为4s左右。</p>
      <h3>输入</h3>
      <dl class="message-properties">
          <dt>payload
              <span class="property-type">string</span>
          </dt>
          <dd>萤石云设备序列号</dd>
          <dt>channelNo
              <span class="property-type">int</span>
          </dt>
          <dd>通道号，不传表示设备本身</dd>
          <dt>enable
              <span class="property-type">int</span>
          </dt>
          <dd>状态：0-关闭，1-开启</dd>
        
      </dl>
      <h3>输出</h3>
      <p>当发生错误的时候，将会从输出2里面输出msg.payload = {} ,如果需要请做相关业务处理</p> 
</script>